<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Content-Language" content="zh-CN" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>时光叶片</title>
		<link type="text/css" rel="stylesheet" href="css/style-time.css" />
		<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
		<link rel="stylesheet" href="css/style-timeBlade.css" type="text/css">
		<script src="js/jquery.min.js"></script>
	</head>
	<body class="bg-news">

		<div class="container">
			<div class="showDiv timeInfo infoBox row">
				<div class="userInfo col-md-12">
					<h1><span id="timeBladeTitle">timeBladeTitle</span></h1>
					<div class="from">
						<img src="getImg.do?imgId=2305107_50" class="avatar">
						<a target="_blank" href="index.do" class="mr green"><span id="axisId">null</span></a>
						<span class="mr" id="pushDate">发布于2018年06月27日</span>
					</div>
					<div class="editor-viewer text clear" id="timeBladeInfo">
					</div>

				</div>
				<div class="userbutton col-md-12">
					<div class="btns-btn">
						<a href="index.do"> <span class="operate_title">返回</span>
						</a>
					</div>
					<div class="btns-btn opr-btn-news hover">
						<a href="javascript:void(0);" class=""> 分享 </a>
					</div>
				</div>
			</div>
			<div class="showDiv timeMessage row">
				<div class="panel-heading col-md-12" id="blog-comments-list">
					<div class="count-of-comment">
						评论 <span class="reply_count">(<span id="messageSum">2</span>)
						</span>
					</div>
				</div>
				<div class="comment-panel-wrapper">
					<div class="panel comp-comments-panel" id="comment-list">
						<div class="">
							<div class="panel-comment-form">

								<div class="SpaceList">
									<div class="comp-comment-form comment-emoji" id="commentFormScope">
										<div id="form_comment">
											<div class="comment_form">
												<textarea name="msgContent" id="msgContent" placeholder=""></textarea>
												<div class="box editor-toolbox">
													<div class="box-fr">

														<button class="btn-green" onclick="sendMSGVIP()">发表评论</button>
													</div>
													<div class="box vertical box-aw"></div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="box vertical">
								<span class="box-fl">最新评论</span>
								<hr class="box-aw">
							</div>
							<div class="insert-comment-flag" id="msgBar"></div>
							<p class="no_more_data_flag" data-flag="true">没有更多评论</p>
						</div>
					</div>

				</div>

			</div>
		</div>

		<script src="js/shiyiTool.js"></script>
		<!-- <script src="js/bootstrap_3.3.7_js_bootstrap.min.js"></script> -->
		<script type="text/javascript">
			var info_timeBladeId = getParValue(window.location.href, "timeBladeId");
			var info_timeBlade = null;
			var info_axisId = null;
			var info_message = null;
		</script>
		<script type="text/javascript">
			// ajax获取信息
			info_timeBlade = ajax_getTimeInfo(info_timeBladeId);
			console.log(info_timeBlade); // OK
			info_axisId = info_timeBlade.axisId;
			console.log(info_axisId); // OK
			info_message = ajax_getAllMsg(info_timeBladeId);
			console.log(info_message); // OK
			console.log(info_message.length);
		</script>

		<script type="text/javascript">
			function formatDate(now) {
				var now = new Date(now);
				var year = now.getFullYear();
				var month = now.getMonth() + 1;
				var date = now.getDate();
				var hour = now.getHours();
				var minute = now.getMinutes();
				var second = now.getSeconds();
				return year + "年" + fixZero(month, 2) + "月" + fixZero(date, 2) +
					"日" + fixZero(hour, 2) + ":" + fixZero(minute, 2) + ":" +
					fixZero(second, 2);
			}
			//时间如果为单位数补0 
			function fixZero(num, length) {
				var str = "" + num;
				var len = str.length;
				var s = "";
				for (var i = length; i-- > len;) {
					s += "0";
				}
				return s + str;
			}
		</script>


		<script type="text/javascript">
			function sendMSGVIP() {
				in_content = $('#msgContent').val();

				var in_name = prompt('请输入你的称呼:');
				if (in_name == '' || in_name == null) {
					alert('请正确进行输入。');
					return;
				}
				var in_pw = prompt('请输入你的评论密码:');
				if (in_pw == '' || in_pw == null) {
					alert('请正确进行输入。');
					return;
				}

				var result = ajax_sendMsg(info_timeBlade.timeBladeId, in_pw,
					in_name, in_content);
				alert(result);
				console.log(result);
				window.location.reload();
			}
		</script>

		<script type="text/javascript">
			$(function() {
				$("#pushDate").text(formatDate(info_timeBlade.pushDate));
				$("#axisId").text(info_axisId);
				$("#timeBladeTitle").text(info_timeBlade.timeBladeTitle);
				$("#timeBladeInfo").text(info_timeBlade.timeBladeInfo);
				$("#messageSum").text(info_message.length);
				for (var i = info_message.length - 1; i >= 0; i--) {
					var temp = info_message[i];
					var dom = '<div class="comment-item comment-emoji" id="cmt_97487_3808054_296074810">' +
						'<div class="box"><div class="box-fl"><div class="icon"><a href="https://my.oschina.net/u/3808054"> <img title="twobox" class="SmallPortrait" alt="' +
						temp.msgName +
						'" src="getImg.do?imgId=2305107_50" /></a></div></div><div class="box-aw"><div class="box"><div class="box-aw"><div class="user-name"><a class="user" href="#">' +
						temp.msgName +
						'</a></div><div class="user-info"><span>' +
						i +
						'</span>楼 今天 ' +
						formatDate(temp.msgTime-(14*60*60*1000)) +
						'</div></div></div><div class="comment-content" style="overflow: hidden; opacity: 1;" data-emoji-render="true">' +
						temp.msgContent +
						'</div><div class="inline_reply"	id="inline_reply_of_97487_3808054_296074810"></div></div></div></div>';
					$('#msgBar').append(dom);
				}

			});
		</script>

		<!-- 
////////////////////////////////////////////////////////////////////
//                            _ooOoo_                             //
//                           o8888888o                            //    
//                           88" . "88                            //    
//                           (| ^_^ |)                            //    
//                           O\  =  /O                            //
//                        ____/`---'\____                         //                        
//                      .'  \\|     |//  `.                       //
//                     /  \\|||  :  |||//  \                      //    
//                    /  _||||| -:- |||||-  \                     //
//                    |   | \\\  -  /// |   |                     //
//                    | \_|  ''\---/''  |   |                     //        
//                    \  .-\__  `-`  ___/-. /                     //        
//                  ___`. .'  /--.--\  `. . ___                   //    
//                ."" '<  `.___\_<|>_/___.'  >'"".                //
//              | | :  `- \`.;`\ _ /`;.`/ - ` : | |               //    
//              \  \ `-.   \_ __\ /__ _/   .-` /  /               //
//        ========`-.____`-.___\_____/___.-`____.-'========       //    
//                             `=---='                            //
//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      //
//         佛祖保佑       永无BUG        永不修改                    			  //
////////////////////////////////////////////////////////////////////
-->
	</body>

</html>
